home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / WebViewer / Origin / WebViewer.jar / r.class (.txt) < prev    next >
Encoding:
Java Class File  |  2003-04-21  |  1.0 KB  |  77 lines

  1. import java.io.IOException;
  2. import java.io.InputStream;
  3.  
  4. // $FF: renamed from: r
  5. class class_0 extends InputStream {
  6.    // $FF: renamed from: a java.io.InputStream
  7.    protected InputStream field_0;
  8.    // $FF: renamed from: c int
  9.    protected int field_1 = 0;
  10.    // $FF: renamed from: b boolean
  11.    private boolean field_2;
  12.  
  13.    public class_0(InputStream var1, boolean var2) {
  14.       this.field_0 = var1;
  15.       this.field_2 = var2;
  16.    }
  17.  
  18.    public int available() throws IOException {
  19.       return this.field_0.available();
  20.    }
  21.  
  22.    public void close() throws IOException {
  23.       this.field_0.close();
  24.    }
  25.  
  26.    public int read() throws IOException {
  27.       int var1 = this.field_0.read();
  28.       if (var1 != -1) {
  29.          ++this.field_1;
  30.       }
  31.  
  32.       return var1;
  33.    }
  34.  
  35.    public int read(byte[] var1) throws IOException {
  36.       return this.read(var1, 0, var1.length);
  37.    }
  38.  
  39.    public int read(byte[] var1, int var2, int var3) throws IOException {
  40.       if (!this.field_2) {
  41.          int var6 = this.field_0.read(var1, var2, var3);
  42.          if (var6 > 0) {
  43.             this.field_1 += var6;
  44.          }
  45.  
  46.          return var6;
  47.       } else if (var2 >= 0 && var3 >= 0 && var2 + var3 <= var1.length) {
  48.          int var4;
  49.          int var5;
  50.          for(var4 = 0; var4 < var3; var1[var2 + var4++] = (byte)var5) {
  51.             var5 = this.field_0.read();
  52.             if (var5 == -1) {
  53.                if (var4 == 0) {
  54.                   return -1;
  55.                }
  56.                break;
  57.             }
  58.  
  59.             ++this.field_1;
  60.          }
  61.  
  62.          return var4;
  63.       } else {
  64.          throw new IndexOutOfBoundsException();
  65.       }
  66.    }
  67.  
  68.    public long skip(long var1) throws IOException {
  69.       long var3 = this.field_0.skip(var1);
  70.       if (var3 > 0L) {
  71.          this.field_1 += (int)var3;
  72.       }
  73.  
  74.       return var3;
  75.    }
  76. }
  77.